package com.example.anew.journey.mynewjourney.firstchangelogic.firstChangeChangePassword;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.example.anew.journey.mynewjourney.R;
import com.example.anew.journey.mynewjourney.base.FirstChangeAllBaseActivity;
import com.example.anew.journey.mynewjourney.firstchangelogic.firstChangeChangePassword.persenter.FirstChangeChangePasswordPersenter;
import com.example.anew.journey.mynewjourney.firstchangelogic.firstChangeChangePassword.view.ISFirstChangeChangePasswordView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 杭州惟君医疗科技有限公司14
 * Created by 20433 on 2018/3/16
 */

public class FirstChangeChangePasswordActivity extends FirstChangeAllBaseActivity implements ISFirstChangeChangePasswordView {
    @Bind(R.id.activity_first_change_password_et_your_current_password)
    EditText activityFirstChangePasswordEtYourCurrentPassword;
    @Bind(R.id.linearLayout6)
    LinearLayout linearLayout6;
    @Bind(R.id.activity_first_change_password_et_new_password)
    EditText activityFirstChangePasswordEtNewPassword;
    @Bind(R.id.linearLayout7)
    LinearLayout linearLayout7;
    @Bind(R.id.activity_first_change_password_et_confirm_password)
    EditText activityFirstChangePasswordEtConfirmPassword;
    @Bind(R.id.linearLayout8)
    LinearLayout linearLayout8;
    @Bind(R.id.activity_first_change_password_bt_complete)
    Button activityFirstChangePasswordBtComplete;
    private View view;
    private FirstChangeChangePasswordPersenter mFirstChangeChangePasswordPersenter = new FirstChangeChangePasswordPersenter(this);

    /**
     * @desc 主要内容的布局资源填充进来
     */
    @Override
    protected View setMainContentView() {
        view = View.inflate(this, R.layout.activity_first_change_password, null);
         ButterKnife.bind(this, view);
        return view;
    }

    /**
     * @desc 初始化数据 onCreate()
     */
    @Override
    protected void initView(View view) {
        displayToolbar();
        displayReturn();
        displayTvName();

        setToolbarBg(0xff2196F3);
        setReturnrePictuResources(R.mipmap.return_02);
        setTvNameEachAttribute(20, 0xffffffff, "修改密码");
    }

    /**
     * @desc Activity 销毁 释放资源
     */
    @Override
    protected void releaseResources() {
        ButterKnife.unbind(view);
    }

    /**
     * @desc 网络监听 用于提示用户有网络了
     */
    @Override
    protected void promptHaveInternet() {

    }

    /**
     * @desc 网络监听 用于提示用户没有网络了
     */
    @Override
    protected void promptNoInternet() {

    }

    /**
     * @desc 点击分享按钮
     */
    @Override
    protected void onClickShared() {

    }

    /**
     * @desc 点击发布按钮
     */
    @Override
    protected void onClickRelease() {

    }

    /**
     * @desc 点击返回按钮
     */
    @Override
    protected void onClickReturn() {
        finish();
    }



    @OnClick(R.id.activity_first_change_password_bt_complete)
    public void onViewClicked() {
        mFirstChangeChangePasswordPersenter.onClickBtComplete(this);
    }
    // 显示提示Toast信息
    @Override
    public void showToastInformation(String str) {
        Toast.makeText(this,str,Toast.LENGTH_SHORT).show();
    }
    // 显示进度
    @Override
    public void displayProgress() {

    }
    // 隐藏进度
    @Override
    public void hiddenProgress() {

    }
    //完成
    @Override
    public void onClickeComplete() {
            finish();
    }
    //获取输入的 当前密码
    @Override
    public String getCurrentPassword() {
        return activityFirstChangePasswordEtYourCurrentPassword.getText().toString().trim();
    }
    //设置输入的 当前密码
    @Override
    public void setCurrentPassword(String str) {
        activityFirstChangePasswordEtYourCurrentPassword.setText(str);
    }
    //获取输入的 新密码
    @Override
    public String getNewPassword() {
        return activityFirstChangePasswordEtNewPassword.getText().toString().trim();
    }
    //设置输入的 新密码
    @Override
    public void setNewPassword(String str) {
        activityFirstChangePasswordEtNewPassword.setText(str);
    }
    //获取输入的 确认密码
    @Override
    public String getConfirmPassword() {
        return activityFirstChangePasswordEtConfirmPassword.getText().toString().trim();
    }
    //设置输入的 确认密码
    @Override
    public void setConfirmPassword(String str) {
        activityFirstChangePasswordEtConfirmPassword.setText(str);
    }
}
